<?php

require_once __DIR__ . '/includes/BasketbalFunctions.php';
$basketbalfunctions = new BasketbalFunctions();

include_once __DIR__ . '/db_bb_connect.php';

$video_ID = $_POST['video_ID'];

?>	
			<h4>Current visibility:</h4>

			 <table class="table table-hover" id="sorttable">
    <tbody>

<?php 

$sql = "SELECT *  
		FROM video_other_visibility
		WHERE video_ID = '$video_ID'";

$result = $db->query($sql);

while ($row = $result->fetch_assoc()) {
				$user_key = $row['user_key'];
				$entry_ID = $row['ID'];

				$player_firstname = $basketbalfunctions->GetUserFirstnameFromUserkey($user_key);
				$player_lastname = $basketbalfunctions->GetUserLastnameFromUserkey($user_key);
				
				echo "<tr id='tablerow$entry_ID'> 
				<td> $player_firstname $player_lastname </td> 
				<td> <form> <input type='hidden' name='entry_ID' value='$entry_ID'><input class='delete_visibility' type='image' name='submit' src='./images/delete_button.png' title='Delete entry' width='30px' alt='Submit' /></form> </td>
				</tr>";
};

?>
</tbody>
</table>